package com.chengcang.api.modules.busi.dto;


import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

@Data
public class BusiAddressPageDTO implements Serializable {
    private static final long serialVersionUID = 1L;

    //---------------------------分页参数---------------------------
    @ApiModelProperty(value = "页码，从1开始")
    private int pageIndex;

    @ApiModelProperty(value = "每页数据量")
    private int pageSize;

    private int offset;

    //---------------------------不规范的默认排序字段常量, 没必要抽取---------------------------
    private String orderField = "create_date";

    private String order = "desc";


    @ApiModelProperty(value = "id")
    private Long id;

    @ApiModelProperty(value = "编号")
    private String addrNo;

    @ApiModelProperty(value = "收货标签")
    private String tag;

    @ApiModelProperty(value = "收货人")
    private String consignee;

    @ApiModelProperty(value = "收货地址")
    private String address;

    @ApiModelProperty(value = "省份id")
    private Long provinceId;

    @ApiModelProperty(value = "省份名称")
    private String provinceName;

    @ApiModelProperty(value = "地市id")
    private Long cityId;

    @ApiModelProperty(value = "地市名称")
    private String cityName;

    @ApiModelProperty(value = "区县id")
    private Long areaId;

    @ApiModelProperty(value = "区县名称")
    private String areaName;

    @ApiModelProperty(value = "客户id")
    private Long tenantId;

    @ApiModelProperty(value = "联系方式")
    private String addressMobile;

    @ApiModelProperty(value = "创建人员")
    private Long creator;

    @ApiModelProperty(value = "更新人员")
    private Long updater;

    @ApiModelProperty(value = "创建时间")
    private Date createDate;

    @ApiModelProperty(value = "更新时间")
    private Date updateDate;

    @ApiModelProperty(value = "0 有效 1 无效")
    private Integer deleted;

    @ApiModelProperty(value = "是否默认 0 是 1否")
    private Integer defaulted;


    public void setPageIndex(int pageIndex){
        this.pageIndex = pageIndex;
        this.offset = this.pageSize * (pageIndex-1);
    }

    public void setPageSize(int pageSize){
        this.pageSize = pageSize;
        this.offset = pageSize * (this.pageIndex-1);
    }
}
